@treasure-ai/treasure-deck 0.0.0-stage → 2026.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE.md +5 -0
  2. package/README.md +109 -2
  3. package/dist/analytics.d.ts +34 -0
  4. package/dist/analytics.js +93 -0
  5. package/dist/analytics.js.map +1 -0
  6. package/dist/attrs.d.ts +10 -0
  7. package/dist/attrs.js +22 -0
  8. package/dist/attrs.js.map +1 -0
  9. package/dist/build.d.ts +67 -0
  10. package/dist/build.js +247 -0
  11. package/dist/build.js.map +1 -0
  12. package/dist/check.d.ts +30 -0
  13. package/dist/check.js +142 -0
  14. package/dist/check.js.map +1 -0
  15. package/dist/chrome.d.ts +20 -0
  16. package/dist/chrome.js +162 -0
  17. package/dist/chrome.js.map +1 -0
  18. package/dist/cli.d.ts +2 -0
  19. package/dist/cli.js +246 -0
  20. package/dist/cli.js.map +1 -0
  21. package/dist/dev.d.ts +28 -0
  22. package/dist/dev.js +557 -0
  23. package/dist/dev.js.map +1 -0
  24. package/dist/diagrams.d.ts +18 -0
  25. package/dist/diagrams.js +57 -0
  26. package/dist/diagrams.js.map +1 -0
  27. package/dist/highlight.d.ts +7 -0
  28. package/dist/highlight.js +26 -0
  29. package/dist/highlight.js.map +1 -0
  30. package/dist/hot.d.ts +31 -0
  31. package/dist/hot.js +34 -0
  32. package/dist/hot.js.map +1 -0
  33. package/dist/media.d.ts +24 -0
  34. package/dist/media.js +82 -0
  35. package/dist/media.js.map +1 -0
  36. package/dist/parse.d.ts +109 -0
  37. package/dist/parse.js +313 -0
  38. package/dist/parse.js.map +1 -0
  39. package/dist/patch.d.ts +22 -0
  40. package/dist/patch.js +53 -0
  41. package/dist/patch.js.map +1 -0
  42. package/dist/pdf.d.ts +10 -0
  43. package/dist/pdf.js +53 -0
  44. package/dist/pdf.js.map +1 -0
  45. package/dist/render.d.ts +101 -0
  46. package/dist/render.js +513 -0
  47. package/dist/render.js.map +1 -0
  48. package/dist/scaffold.d.ts +27 -0
  49. package/dist/scaffold.js +83 -0
  50. package/dist/scaffold.js.map +1 -0
  51. package/dist/themecheck.d.ts +34 -0
  52. package/dist/themecheck.js +228 -0
  53. package/dist/themecheck.js.map +1 -0
  54. package/docs/adrs/2026-10-03-chrome-over-devtools.md +29 -0
  55. package/docs/adrs/2026-10-03-fixed-canvas.md +25 -0
  56. package/docs/adrs/2026-10-03-four-layouts-plus-attributes.md +25 -0
  57. package/docs/adrs/2026-10-03-hybrid-pdf-over-devtools.md +25 -0
  58. package/docs/adrs/2026-10-03-keyword-lines-and-one-attribute-syntax.md +36 -0
  59. package/docs/adrs/2026-10-03-one-behavior-instead-of-settings.md +30 -0
  60. package/docs/adrs/2026-10-03-overflow-is-reported-not-hidden.md +27 -0
  61. package/docs/adrs/2026-10-03-single-file-html.md +26 -0
  62. package/docs/adrs/2026-10-03-strict-build-forgiving-preview.md +31 -0
  63. package/docs/adrs/2026-10-04-edit-in-place-by-alignment.md +28 -0
  64. package/docs/adrs/2026-10-04-editor-in-the-deck-page.md +31 -0
  65. package/docs/adrs/2026-10-04-edits-are-line-range-patches.md +35 -0
  66. package/docs/adrs/2026-10-04-per-slide-hot-swap.md +33 -0
  67. package/docs/adrs/2026-10-04-theme-colors-derive-in-css.md +32 -0
  68. package/docs/adrs/2026-10-05-host-owns-undo.md +26 -0
  69. package/docs/adrs/2026-10-07-anonymous-access-metrics.md +38 -0
  70. package/docs/adrs/2026-10-14-dev-links-media-by-url.md +25 -0
  71. package/docs/adrs/2026-10-14-media-dir-for-the-publish-limit.md +28 -0
  72. package/docs/adrs/2026-10-14-videos-are-inlined-images.md +28 -0
  73. package/docs/adrs/2026-10-15-public-npm-under-labs-terms.md +37 -0
  74. package/docs/adrs/README.md +34 -0
  75. package/docs/commands.md +104 -0
  76. package/docs/editor.md +114 -0
  77. package/docs/syntax.md +157 -0
  78. package/docs/themes.md +134 -0
  79. package/package.json +68 -4
  80. package/runtime/base.css +354 -0
  81. package/runtime/edit-core.cjs +877 -0
  82. package/runtime/embed.js +5259 -0
  83. package/runtime/hot.js +136 -0
  84. package/runtime/runtime.js +729 -0
  85. package/skills/treasure-deck/SKILL.md +136 -0
  86. package/templates/deck.md +78 -0
  87. package/templates/specimen/specimen.md +104 -0
  88. package/templates/theme/assets/mark.svg +1 -0
  89. package/templates/theme/theme.css +97 -0
  90. package/templates/theme/theme.yaml +7 -0
  91. package/themes/default/theme.css +183 -0
  92. package/themes/default/theme.yaml +6 -0
  93. package/themes/editorial/theme.css +168 -0
  94. package/themes/editorial/theme.yaml +7 -0
  95. package/themes/gold/assets/gem.svg +130 -0
  96. package/themes/gold/theme.css +303 -0
  97. package/themes/gold/theme.yaml +7 -0
  98. package/themes/pastel/theme.css +187 -0
  99. package/themes/pastel/theme.yaml +6 -0
  100. package/themes/treasure-ai/assets/gem-line.svg +7 -0
  101. package/themes/treasure-ai/assets/gem.png +0 -0
  102. package/themes/treasure-ai/assets/gem.svg +25 -0
  103. package/themes/treasure-ai/assets/glass.svg +12 -0
  104. package/themes/treasure-ai/assets/logo-white.png +0 -0
  105. package/themes/treasure-ai/assets/logo.png +0 -0
  106. package/themes/treasure-ai/theme.css +239 -0
  107. package/themes/treasure-ai/theme.yaml +6 -0
  108. package/themes/wvlet/assets/wvlet-icon.svg +27 -0
  109. package/themes/wvlet/theme.css +238 -0
  110. package/themes/wvlet/theme.yaml +6 -0
package/LICENSE.md ADDED
@@ -0,0 +1,5 @@
1
+ # License
2
+
3
+ treasure-deck is a Treasure AI Labs offering. Your use of it, including the decks you build with it, is governed by the [Treasure AI Labs Terms of Use](https://www.treasure.ai/terms/labs-terms-of-use).
4
+
5
+ It is not open-source software: these terms, not an open-source license, say what you may do with it. Its third-party dependencies, installed alongside it by npm, keep their own licenses.
package/README.md CHANGED
@@ -1,3 +1,110 @@
1
- # Temporary Holding Version
1
+ # treasure-deck
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Markdown presentations without `<div>` markup. A deck is a folder with one Markdown file and its images. `deck build` turns it into a single self-contained HTML page with keyboard navigation, full screen, an overview grid, speaker notes, and a share panel, ready to publish as an Apps Script web app from Treasure Work.
4
+
5
+ ```markdown
6
+ ---
7
+ deck: true
8
+ theme: gold # default | editorial | pastel | gold | treasure-ai | wvlet | ./my-theme
9
+ footer: "Treasure AI · DB Study Group"
10
+ ---
11
+ --- title
12
+
13
+ # Treasure Work: Your *AI-Native* Workspace
14
+
15
+ Three-Layer Architecture to Leverage AI{.subtitle}
16
+
17
+ September 14, 2026{.meta}
18
+
19
+ --- columns 3:2
20
+
21
+ # About Me
22
+
23
+ - Creator of **Treasure Code** and **Treasure Work**
24
+
25
+ === col
26
+
27
+ ![](me.png){h=400 shadow}
28
+
29
+ === notes
30
+ Mention the DDIA translation.
31
+ ```
32
+
33
+ `---` starts a slide (with an optional layout), `=== col` / `=== row` / `=== notes` divide it, and `{…}` after a block, image, or span sets classes and attributes. Everything else is CommonMark + GFM. Unknown layouts, attributes, and classes fail the build with a line number. The full reference is in [docs/syntax.md](https://unpkg.com/@treasure-ai/treasure-deck/docs/syntax.md).
34
+
35
+ ## Install
36
+
37
+ treasure-deck needs Node.js 22 or later, and Chrome (or another Chromium-based browser) for `deck pdf`, `deck check`, and diagrams in built decks.
38
+
39
+ ```sh
40
+ npm install -g @treasure-ai/treasure-deck # puts `deck` on your PATH
41
+ deck --version
42
+ ```
43
+
44
+ Or run it without installing: `npx @treasure-ai/treasure-deck build talk.md`. To update, run the install command again (`npm install -g @treasure-ai/treasure-deck@latest`). `@next` installs the newest release before it's promoted to stable.
45
+
46
+ ## Quick start
47
+
48
+ ```sh
49
+ deck new talks/q3-review --theme treasure-ai # a starter deck that already builds
50
+ deck editor talks/q3-review/q3-review.md # edit it in the browser: thumbnails, the slide, an editor below
51
+ deck check talks/q3-review/q3-review.md # overflow, clipped code, unreadable diagrams, with source lines
52
+ deck build talks/q3-review/q3-review.md # → q3-review.html, one self-contained file
53
+ deck skill install # teach Claude Code the syntax and house style
54
+ ```
55
+
56
+ | You want to | Run |
57
+ |---|---|
58
+ | Start a deck | `deck new <dir or file.md>` |
59
+ | Write the Markdown in your own editor and watch the slides | `deck dev talk.md` (live reload at http://localhost:4300) |
60
+ | Edit on the slides, in a browser or Treasure Work's dock | `deck editor talk.md` |
61
+ | Present | `f` full screen, `P` presenter window, `p` notes, `?` all keys |
62
+ | Check it before sharing | `deck check talk.md [--snapshots dir]` |
63
+ | Share it | `deck build talk.md` (HTML) or `deck pdf talk.md` |
64
+ | Teach Claude Code the syntax and house style | `deck skill install` |
65
+ | Make a theme | `deck theme init my-theme`, then `deck theme check ./my-theme` |
66
+
67
+ ## Documentation
68
+
69
+ The guides ship in the package's `docs/` folder and are readable without an account:
70
+
71
+ - [Syntax](https://unpkg.com/@treasure-ai/treasure-deck/docs/syntax.md): frontmatter, slides and layouts, columns and rows, images, classes, code, and diagrams.
72
+ - [Editor](https://unpkg.com/@treasure-ai/treasure-deck/docs/editor.md): `deck editor`, with the formatted and Markdown views, keys, images, and undo.
73
+ - [Commands](https://unpkg.com/@treasure-ai/treasure-deck/docs/commands.md): `deck dev`, `check`, `build`, `pdf`, `new`, `skill`, and the keys for presenting.
74
+ - [Themes](https://unpkg.com/@treasure-ai/treasure-deck/docs/themes.md): the built-in themes, `theme.css` tweaks, and writing your own.
75
+
76
+ ## Access metrics
77
+
78
+ A deck built with `deck build` reports anonymous views to Treasure AI: page opens, the slides viewed and for how long, and the presenting features used. It sets no cookie and assigns no ID that recognizes a returning viewer. `deck dev`, `deck editor`, `deck pdf`, and `deck check` send nothing, and a deck that can't reach Treasure Data's CDN works as before. The fields are listed in [Commands](https://unpkg.com/@treasure-ai/treasure-deck/docs/commands.md).
79
+
80
+ ## Feedback
81
+
82
+ Report bugs and ask for features in [treasure-data/treasure-ai-labs](https://github.com/treasure-data/treasure-ai-labs/issues), the public issue tracker for Treasure AI Labs products. Use the `treasure-deck` label and include `deck --version`.
83
+
84
+ ## License
85
+
86
+ treasure-deck is a Treasure AI Labs offering, provided under the [Treasure AI Labs Terms of Use](https://www.treasure.ai/terms/labs-terms-of-use); see [LICENSE.md](https://unpkg.com/@treasure-ai/treasure-deck/LICENSE.md). It is not open-source software, and the source repository doesn't take outside contributions.
87
+
88
+ ## Development
89
+
90
+ With access to the source repository ([treasure-data/treasure-deck](https://github.com/treasure-data/treasure-deck)), work in a checkout and run the CLI as `pnpm deck …`. [Design](docs/design.md) covers how it is built (pipeline, runtime, host protocol, editor internals) and what is planned, and the [architecture decision records](docs/adrs/README.md) say why the important internal designs are the way they are.
91
+
92
+ `examples/playground/playground.md` is a deck for trying the editor (copy it first, since edits save to the file), and `pnpm demo` builds a feature tour in every theme.
93
+
94
+ ```sh
95
+ pnpm install
96
+ pnpm deck build examples/hello/hello.md # writes examples/hello/hello.html
97
+ pnpm deck dev examples/hello/hello.md # http://localhost:4300 with live reload
98
+ pnpm demo # feature tour in all themes → examples/tour/tour-<theme>.html
99
+ pnpm deck pdf examples/tour/tour.md --theme gold # PDF that looks like the HTML (needs Chrome; CHROME_PATH overrides)
100
+ pnpm demo:pdf # tour PDFs in all themes
101
+ pnpm test
102
+ pnpm typecheck
103
+ ```
104
+
105
+ Layout: `src/parse.ts` (slide splitting, headers, `=== col`, `=== notes`), `src/render.ts` (Markdown → slide HTML, image attributes, validation), `src/build.ts` (themes, single-file assembly), `src/dev.ts` (`deck dev`, `deck editor`), `src/patch.ts` (line-range patches for visual edits), `src/check.ts` / `src/pdf.ts` / `src/chrome.ts` (headless Chrome), `runtime/` (base CSS, the navigation runtime, the editor bridge `embed.js` and its pure edit functions `edit-core.cjs`), `themes/<name>/` (`theme.yaml` + `theme.css`). Implementation plans for larger changes are in `plans/`.
106
+
107
+ Releases follow tdx's CalVer and two channels, run by `.github/workflows/release.yml`. Neither step needs a PR. `package.json` stays `0.0.0-dev`; the tag sets the version.
108
+
109
+ 1. **`pnpm release`**, on an up-to-date `main`, tags it with the next version and pushes the tag after you confirm. The third number counts releases within the month, from 0. The workflow tests the tag, publishes it under npm's `next` tag, and creates a GitHub prerelease with generated notes.
110
+ 2. **`pnpm promote [version]`**, after trying it (`npm install -g @treasure-ai/treasure-deck@next`), runs the Release workflow for that version. Without a version, it offers the current `next`. The workflow moves npm's `latest` tag to that version and marks its GitHub release as the latest.
@@ -0,0 +1,34 @@
1
+ /** Treasure Data's write-only key for the `treasure_deck` database. It can't read data, so it's safe in a public page. */
2
+ export declare const WRITE_KEY = "1/6e736930125b55c88a472f9f11f63fb89dd0d2c2";
3
+ export declare const DATABASE = "treasure_deck";
4
+ export declare const TABLE = "views";
5
+ export declare const HOST = "us01.records.in.treasuredata.com";
6
+ /** Always https, unlike the SDK's stock loader, which picks http on a file:// page. */
7
+ export declare const SDK_URL = "https://cdn.treasuredata.com/sdk/4.4/td.min.js";
8
+ /** What every row says about the deck, fixed at build time. */
9
+ export interface DeckInfo {
10
+ deck: string;
11
+ /** A hash of the deck file's absolute path: stable across rebuilds and title changes, and not the path itself. */
12
+ deck_id: string;
13
+ /** The treasure-deck version that built it. */
14
+ deck_version: string;
15
+ theme: string;
16
+ /** The build date, YYYY-MM-DD. */
17
+ built_at: string;
18
+ }
19
+ export declare function deckInfo(file: string, title: string, theme: string, now?: Date): DeckInfo;
20
+ /**
21
+ * Add the access metrics script to a built page, before the runtime. `deck build` calls it last, after the
22
+ * diagrams are rendered in headless Chrome, so that render never sends an event; `deck dev`, `editor`, `pdf`,
23
+ * and `check` never call it.
24
+ */
25
+ export declare function withAnalytics(html: string, info: DeckInfo, writeKey?: string): string;
26
+ /**
27
+ * The inline script, or '' without a write key. It goes before the runtime, which shows the first slide as it
28
+ * starts. It queues calls until the SDK loads (the SDK's own loader stub) and listens for the runtime's
29
+ * `deck:show` and `deck:action` events. A deck that can't reach the CDN works as before; it just sends nothing.
30
+ *
31
+ * Every row carries the deck's build info, `host` (apps_script, file, or web), and `view_id`: a random ID made for
32
+ * each page load and never stored, which groups one viewing's rows without identifying the viewer.
33
+ */
34
+ export declare function analyticsScript(info: DeckInfo, writeKey?: string): string;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Access metrics for built decks: the TD JS SDK, in anonymous mode (no cookies, no client or global ID), records
3
+ * into `treasure_deck.views` on us01 when a deck opens, each slide viewed with the time spent on it, and the
4
+ * features used (full screen, presenter window, overview, share, print, …).
5
+ */
6
+ import { createHash } from 'node:crypto';
7
+ import * as path from 'node:path';
8
+ import { VERSION } from './build.js';
9
+ /** Treasure Data's write-only key for the `treasure_deck` database. It can't read data, so it's safe in a public page. */
10
+ export const WRITE_KEY = '1/6e736930125b55c88a472f9f11f63fb89dd0d2c2';
11
+ export const DATABASE = 'treasure_deck';
12
+ export const TABLE = 'views';
13
+ export const HOST = 'us01.records.in.treasuredata.com';
14
+ /** Always https, unlike the SDK's stock loader, which picks http on a file:// page. */
15
+ export const SDK_URL = 'https://cdn.treasuredata.com/sdk/4.4/td.min.js';
16
+ const RUNTIME_START = '<script>\n/* treasure-deck runtime';
17
+ export function deckInfo(file, title, theme, now = new Date()) {
18
+ return {
19
+ deck: title,
20
+ deck_id: createHash('sha256').update(path.resolve(file)).digest('hex').slice(0, 16),
21
+ deck_version: VERSION,
22
+ theme,
23
+ built_at: now.toISOString().slice(0, 10),
24
+ };
25
+ }
26
+ /**
27
+ * Add the access metrics script to a built page, before the runtime. `deck build` calls it last, after the
28
+ * diagrams are rendered in headless Chrome, so that render never sends an event; `deck dev`, `editor`, `pdf`,
29
+ * and `check` never call it.
30
+ */
31
+ export function withAnalytics(html, info, writeKey = WRITE_KEY) {
32
+ const at = html.indexOf(RUNTIME_START);
33
+ const script = analyticsScript(info, writeKey);
34
+ return at < 0 || !script ? html : html.slice(0, at) + script + html.slice(at);
35
+ }
36
+ const json = (v) => JSON.stringify(v).replace(/</g, '\\u003c');
37
+ /**
38
+ * The inline script, or '' without a write key. It goes before the runtime, which shows the first slide as it
39
+ * starts. It queues calls until the SDK loads (the SDK's own loader stub) and listens for the runtime's
40
+ * `deck:show` and `deck:action` events. A deck that can't reach the CDN works as before; it just sends nothing.
41
+ *
42
+ * Every row carries the deck's build info, `host` (apps_script, file, or web), and `view_id`: a random ID made for
43
+ * each page load and never stored, which groups one viewing's rows without identifying the viewer.
44
+ */
45
+ export function analyticsScript(info, writeKey = WRITE_KEY) {
46
+ if (!writeKey)
47
+ return '';
48
+ return `<script>
49
+ !function(t,e){if(void 0===e[t]){e[t]=function(){e[t].clients.push(this),this._init=[Array.prototype.slice.call(arguments)]},e[t].clients=[];for(var r=["addRecord","blockEvents","fetchServerCookie","fetchGlobalID","fetchUserSegments","resetUUID","ready","setSignedMode","setAnonymousMode","set","trackEvent","trackPageview","trackClicks","unblockEvents"],s=0;s<r.length;s++){var c=r[s];e[t].prototype[c]=function(t){return function(){return this["_"+t]=this["_"+t]||[],this["_"+t].push(Array.prototype.slice.call(arguments)),this}}(c)}var n=document.createElement("script");n.async=!0,n.src=${json(SDK_URL)};var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(n,o)}}("Treasure",window);
50
+ (function () {
51
+ var td = new Treasure(${json({ database: DATABASE, writeKey, host: HOST })});
52
+ td.setAnonymousMode();
53
+ var table = ${json(TABLE)}, info = ${json(info)};
54
+ info.view_id = window.crypto && crypto.randomUUID ? crypto.randomUUID() : Date.now().toString(36) + Math.random().toString(36).slice(2);
55
+ info.host = window.google && google.script ? 'apps_script' : location.protocol === 'file:' ? 'file' : 'web';
56
+ function send(record) {
57
+ for (var k in info) record[k] = info[k];
58
+ td.trackEvent(table, record);
59
+ }
60
+ var opened = false, last = null, since = 0, current = 0, overview = false;
61
+ function leave() {
62
+ if (last === null) return;
63
+ send({ event: 'slide', slide: last.slide, slide_title: last.title, pages: last.pages, dwell_ms: Date.now() - since });
64
+ }
65
+ function action(name) { send({ event: 'action', action: name, slide: current }); }
66
+ // The presenter window mirrors the audience window, which already counts the talk.
67
+ document.addEventListener('deck:show', function (e) {
68
+ var d = e.detail;
69
+ if (d.presenter) return;
70
+ current = d.slide;
71
+ if (!opened) { opened = true; send({ event: 'open', pages: d.pages }); }
72
+ if (d.overview !== overview) { overview = d.overview; if (overview) action('overview'); }
73
+ // Thumbnails passed in the overview weren't read: the overview ends the slide's time, and closing it starts one.
74
+ if (d.overview) { leave(); last = null; return; }
75
+ if (last && last.slide === d.slide) return;
76
+ leave();
77
+ last = d;
78
+ since = Date.now();
79
+ });
80
+ document.addEventListener('deck:action', function (e) { action(e.detail.action); });
81
+ document.addEventListener('fullscreenchange', function () { if (document.fullscreenElement) action('fullscreen'); });
82
+ window.addEventListener('beforeprint', function () { action('print'); });
83
+ // Hidden (another tab, closed, or a phone locked; pagehide is unreliable on mobile) ends the slide's time on
84
+ // screen; shown again, it starts a new one.
85
+ document.addEventListener('visibilitychange', function () {
86
+ if (document.visibilityState === 'hidden') leave();
87
+ else since = Date.now();
88
+ });
89
+ })();
90
+ </script>
91
+ `;
92
+ }
93
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,0HAA0H;AAC1H,MAAM,CAAC,MAAM,SAAS,GAAG,4CAA4C,CAAC;AACtE,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAC;AAC7B,MAAM,CAAC,MAAM,IAAI,GAAG,kCAAkC,CAAC;AACvD,uFAAuF;AACvF,MAAM,CAAC,MAAM,OAAO,GAAG,gDAAgD,CAAC;AAExE,MAAM,aAAa,GAAG,oCAAoC,CAAC;AAc3D,MAAM,UAAU,QAAQ,CAAC,IAAY,EAAE,KAAa,EAAE,KAAa,EAAE,GAAG,GA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I,CAAC,KAAK,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsChD,CAAC;AACF,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Parse the inside of a `{…}` attribute block, using the same grammar as
3
+ * markdown-it-attrs: `.class`, `#id`, `key=value`, `key="quoted value"`, and bare flags.
4
+ */
5
+ export interface Attrs {
6
+ classes: string[];
7
+ id?: string;
8
+ values: Map<string, string>;
9
+ }
10
+ export declare function parseAttrs(text: string): Attrs;
package/dist/attrs.js ADDED
@@ -0,0 +1,22 @@
1
+ const TOKEN = /\s*(?:\.([\w-]+)|#([\w-]+)|([\w-]+)=(?:"([^"]*)"|'([^']*)'|(\S+))|([\w%-]+))/y;
2
+ export function parseAttrs(text) {
3
+ const attrs = { classes: [], values: new Map() };
4
+ const src = text.trim();
5
+ TOKEN.lastIndex = 0;
6
+ while (TOKEN.lastIndex < src.length) {
7
+ const start = TOKEN.lastIndex;
8
+ const m = TOKEN.exec(src);
9
+ if (!m || TOKEN.lastIndex === start)
10
+ throw new Error(`cannot parse attributes: {${text}}`);
11
+ if (m[1])
12
+ attrs.classes.push(m[1]);
13
+ else if (m[2])
14
+ attrs.id = m[2];
15
+ else if (m[3])
16
+ attrs.values.set(m[3], m[4] ?? m[5] ?? m[6] ?? '');
17
+ else if (m[7])
18
+ attrs.values.set(m[7], '');
19
+ }
20
+ return attrs;
21
+ }
22
+ //# sourceMappingURL=attrs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attrs.js","sourceRoot":"","sources":["../src/attrs.ts"],"names":[],"mappings":"AAUA,MAAM,KAAK,GAAG,+EAA+E,CAAC;AAE9F,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,MAAM,KAAK,GAAU,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACxB,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC;IACpB,OAAO,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC;QAC9B,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,SAAS,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,GAAG,CAAC,CAAC;QAC3F,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC9B,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;aAC1B,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;aAC7D,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { DeckError, type Deck } from './parse.js';
2
+ export declare const PACKAGE_ROOT: string;
3
+ export declare const THEMES_DIR: string;
4
+ export declare const RUNTIME_DIR: string;
5
+ export declare const TEMPLATES_DIR: string;
6
+ export declare const SKILLS_DIR: string;
7
+ /** The installed treasure-deck version, from its package.json. */
8
+ export declare const VERSION: string;
9
+ export interface ThemeManifest {
10
+ name: string;
11
+ description?: string;
12
+ default_mode?: 'light' | 'dark';
13
+ fonts?: string[];
14
+ }
15
+ export interface LoadedTheme {
16
+ manifest: ThemeManifest;
17
+ css: string;
18
+ }
19
+ export declare function builtinThemes(): string[];
20
+ /** A theme given as a path (`./brand`, `../themes/brand`, `/abs/brand`) rather than a built-in name. */
21
+ export declare function isThemePath(theme: string): boolean;
22
+ /** The folder of a built-in theme, or of a theme path resolved against `baseDir` (the deck's folder). */
23
+ export declare function themeDir(theme: string, baseDir?: string): string;
24
+ export declare function loadTheme(theme: string, baseDir?: string): LoadedTheme;
25
+ /** Replace `url(assets/…)` references in theme CSS with data: URIs so the page stays one file. */
26
+ export declare function inlineAssets(css: string, dir: string): string;
27
+ /** Class names defined in a stylesheet, so a deck-local theme.css can extend the semantic vocabulary. */
28
+ export declare function classesInCss(css: string): string[];
29
+ /** Marks where the slides go in a built page's `shell`. */
30
+ export declare const STAGE = "<!--deck-stage-->";
31
+ /** A page from its shell and its slides. Spliced, since slide text may hold `$&`. */
32
+ export declare function joinStage(shell: string, units: string[]): string;
33
+ export interface BuildResult {
34
+ html: string;
35
+ /** The page with its slides replaced by STAGE, and the slides: each <section>. */
36
+ shell: string;
37
+ units: string[];
38
+ deck: Deck;
39
+ /** The page's <title>: the deck's `title:` or first heading, without Markdown emphasis. */
40
+ title: string;
41
+ /** The theme's name (from its theme.yaml), also for themes given as a folder path. */
42
+ theme: string;
43
+ /** The text the deck was built from: the deck file (by its name) and each part (by its `parts:` path). */
44
+ sources: Record<string, string>;
45
+ /** The errors shown on error slides, in slide order (a `forgiving` build only). */
46
+ errors: DeckError[];
47
+ /** The local videos in the page, by absolute path, with their size in bytes. */
48
+ videos: Map<string, number>;
49
+ /** The local images and videos inlined into the page, by absolute path, with their size in bytes. */
50
+ inlined: Map<string, number>;
51
+ }
52
+ export interface BuildOptions {
53
+ theme?: string;
54
+ /** Override the deck's `mode:` (`deck theme check` builds its specimen in both). */
55
+ mode?: 'light' | 'dark';
56
+ /** Mark slides and blocks with their source lines (`data-src`), for `deck editor`. */
57
+ sourceMap?: boolean;
58
+ /**
59
+ * Show a slide that can't be built as an error slide, with the message and its source, and build the rest of
60
+ * the deck (`deck dev`). Otherwise the first error is thrown. Errors outside the slides are thrown either way.
61
+ */
62
+ forgiving?: boolean;
63
+ /** Link local images and videos by the URL this returns instead of inlining them (see RenderOptions.mediaUrl). */
64
+ mediaUrl?: (file: string, video: boolean) => string | undefined;
65
+ }
66
+ /** Build a deck Markdown file into one self-contained HTML page. */
67
+ export declare function buildDeck(file: string, options?: BuildOptions): BuildResult;
package/dist/build.js ADDED
@@ -0,0 +1,247 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import * as path from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { parse as parseYaml } from 'yaml';
5
+ import { parseAttrs } from './attrs.js';
6
+ import { DeckError, errorSlide, inFile, parseDeck } from './parse.js';
7
+ import { escapeHtml, Renderer } from './render.js';
8
+ export const PACKAGE_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
9
+ export const THEMES_DIR = path.join(PACKAGE_ROOT, 'themes');
10
+ export const RUNTIME_DIR = path.join(PACKAGE_ROOT, 'runtime');
11
+ export const TEMPLATES_DIR = path.join(PACKAGE_ROOT, 'templates');
12
+ export const SKILLS_DIR = path.join(PACKAGE_ROOT, 'skills');
13
+ /** The installed treasure-deck version, from its package.json. */
14
+ export const VERSION = JSON.parse(readFileSync(path.join(PACKAGE_ROOT, 'package.json'), 'utf8')).version;
15
+ export function builtinThemes() {
16
+ return ['default', 'editorial', 'pastel', 'gold', 'treasure-ai', 'wvlet'];
17
+ }
18
+ /** A theme given as a path (`./brand`, `../themes/brand`, `/abs/brand`) rather than a built-in name. */
19
+ export function isThemePath(theme) {
20
+ return theme.startsWith('.') || /[\\/]/.test(theme);
21
+ }
22
+ /** The folder of a built-in theme, or of a theme path resolved against `baseDir` (the deck's folder). */
23
+ export function themeDir(theme, baseDir = process.cwd()) {
24
+ return isThemePath(theme) ? path.resolve(baseDir, theme) : path.join(THEMES_DIR, theme);
25
+ }
26
+ export function loadTheme(theme, baseDir) {
27
+ const dir = themeDir(theme, baseDir);
28
+ const missing = ['theme.yaml', 'theme.css'].filter((f) => !existsSync(path.join(dir, f)));
29
+ if (missing.length) {
30
+ throw new DeckError(isThemePath(theme)
31
+ ? `theme folder ${dir} is missing ${missing.join(' and ')} (create one with: deck theme init <dir>)`
32
+ : `unknown theme "${theme}" (built-in: ${builtinThemes().join(', ')}; or a folder such as ./my-theme)`);
33
+ }
34
+ const manifest = (parseYaml(readFileSync(path.join(dir, 'theme.yaml'), 'utf8')) ?? {});
35
+ // The name scopes the theme's CSS (.deck[data-theme="<name>"]), so it must be a plain identifier.
36
+ manifest.name ??= path.basename(dir);
37
+ if (!/^[a-z0-9][a-z0-9_-]*$/i.test(manifest.name)) {
38
+ throw new DeckError(`theme name "${manifest.name}" in ${path.join(dir, 'theme.yaml')} must be letters, digits, - or _`);
39
+ }
40
+ return { manifest, css: inlineAssets(readFileSync(path.join(dir, 'theme.css'), 'utf8'), dir) };
41
+ }
42
+ const ASSET_MIME = {
43
+ '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.png': 'image/png', '.webp': 'image/webp', '.svg': 'image/svg+xml',
44
+ };
45
+ /** Replace `url(assets/…)` references in theme CSS with data: URIs so the page stays one file. */
46
+ export function inlineAssets(css, dir) {
47
+ return css.replace(/url\((['"]?)(assets\/[^'")]+)\1\)/g, (_m, _q, rel) => {
48
+ const file = path.join(dir, rel);
49
+ const mime = ASSET_MIME[path.extname(file).toLowerCase()];
50
+ if (!mime || !existsSync(file))
51
+ throw new DeckError(`theme asset not found or unsupported: ${rel}`);
52
+ return `url("data:${mime};base64,${readFileSync(file).toString('base64')}")`;
53
+ });
54
+ }
55
+ /** Class names defined in a stylesheet, so a deck-local theme.css can extend the semantic vocabulary. */
56
+ export function classesInCss(css) {
57
+ const noComments = css.replace(/\/\*[\s\S]*?\*\//g, '');
58
+ return [...new Set([...noComments.matchAll(/\.([a-zA-Z][\w-]*)/g)].map((m) => m[1]))];
59
+ }
60
+ function fontLink(fonts) {
61
+ if (fonts.length === 0)
62
+ return '';
63
+ const families = fonts.map((f) => `family=${f.replace(/ /g, '+')}`);
64
+ return ('<link rel="preconnect" href="https://fonts.googleapis.com">' +
65
+ '<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>' +
66
+ `<link rel="stylesheet" href="https://fonts.googleapis.com/css2?${families.join('&')}&display=swap">`);
67
+ }
68
+ /** Whether a slide's `{…}` attributes carry a bare flag such as `show`. */
69
+ function hasFlag(slide, flag) {
70
+ try {
71
+ return parseAttrs(slide.attrs).values.has(flag);
72
+ }
73
+ catch (e) {
74
+ throw new DeckError(e.message, slide.line, slide.file);
75
+ }
76
+ }
77
+ /** A heading's text without its #, trailing {…}, and emphasis marks. */
78
+ const plain = (md) => md.replace(/^#{1,6}\s+/, '').replace(/\{[^}]*\}\s*$/, '').replace(/[*_`]/g, '').trim();
79
+ /** A section's name: its slide's first heading, as plain text. */
80
+ function sectionTitle(s) {
81
+ return (/^#{1,6}\s+(.*)$/m.exec(s.columns[0].markdown)?.[1] ?? '').replace(/[*_`]/g, '').trim();
82
+ }
83
+ /** The outline for the table of contents sidebar: all sections, and each content slide's title under its section. */
84
+ function buildToc(slides, sectionOf, sections, hidden) {
85
+ const titled = slides.flatMap((s, i) => {
86
+ if (hidden[i] || (s.layout !== 'content' && s.layout !== 'columns'))
87
+ return [];
88
+ const heading = s.header ?? /^#{1,3}\s+.*$/m.exec(s.columns[0].markdown)?.[0];
89
+ return heading ? [{ number: s.number, section: sectionOf[i]?.number ?? 0, title: plain(heading) }] : [];
90
+ });
91
+ // A section's link goes to its first slide on screen: the divider when shown, else the first slide inside it.
92
+ const withStart = sections.map((sec) => {
93
+ const i = sectionOf.findIndex((s, k) => !hidden[k] && s === sec);
94
+ return i >= 0 ? { ...sec, start: slides[i].number } : { ...sec };
95
+ });
96
+ return { sections: withStart, slides: titled };
97
+ }
98
+ /** Marks where the slides go in a built page's `shell`. */
99
+ export const STAGE = '<!--deck-stage-->';
100
+ /** A page from its shell and its slides. Spliced, since slide text may hold `$&`. */
101
+ export function joinStage(shell, units) {
102
+ const at = shell.indexOf(STAGE);
103
+ return shell.slice(0, at) + units.join('\n') + shell.slice(at + STAGE.length);
104
+ }
105
+ /** Build a deck Markdown file into one self-contained HTML page. */
106
+ export function buildDeck(file, options = {}) {
107
+ const baseDir = path.dirname(path.resolve(file));
108
+ const source = readFileSync(file, 'utf8');
109
+ const forgiving = options.forgiving ?? false;
110
+ const deck = parseDeck(source, [], { forgiving });
111
+ const sources = { [path.basename(file)]: source };
112
+ if (deck.meta.parts?.length) {
113
+ const parts = deck.meta.parts.map((p) => ({ file: p, text: readFileSync(path.join(baseDir, p), 'utf8') }));
114
+ for (const p of parts)
115
+ sources[p.file] = p.text;
116
+ Object.assign(deck, parseDeck(source, parts, { forgiving }));
117
+ }
118
+ if (options.theme)
119
+ deck.meta.theme = options.theme;
120
+ if (options.mode)
121
+ deck.meta.mode = options.mode;
122
+ const theme = loadTheme(deck.meta.theme, baseDir);
123
+ const localCssPath = path.join(baseDir, 'theme.css');
124
+ const localCss = existsSync(localCssPath) ? readFileSync(localCssPath, 'utf8') : '';
125
+ const renderer = new Renderer({
126
+ baseDir,
127
+ extraClasses: classesInCss(localCss),
128
+ sourceMap: options.sourceMap ? path.basename(file) : undefined,
129
+ mediaUrl: options.mediaUrl,
130
+ });
131
+ // Every `--- section` names and numbers the eyebrow of the slides after it, but the divider slide itself
132
+ // is shown only with `section_slides: true` or `--- section {show}`. Hidden dividers are dropped before
133
+ // numbering, so page numbers, deep links, and progress count only the slides on screen.
134
+ // `{hide}` drafts a slide out of the deck; on a section slide it hides the whole section (divider and slides)
135
+ // until the next section, which then takes the hidden one's number. The editor (`sourceMap`) keeps hidden slides,
136
+ // marked `.is-hidden` (with the line of the `{hide}` that hides them), to show and edit them; they aren't presented
137
+ // and have no page number, and the others are numbered as presented.
138
+ const keepHidden = !!options.sourceMap;
139
+ let section;
140
+ let hiddenSection = null;
141
+ const sections = [];
142
+ const visible = [];
143
+ const where = (s) => `${s.file ?? path.basename(file)}:${s.line}`;
144
+ // A slide that can't be read is shown, as an error slide, wherever it is.
145
+ const failed = (s, e) => {
146
+ if (!forgiving || !(e instanceof DeckError))
147
+ throw e;
148
+ visible.push({ slide: errorSlide(s, e), section });
149
+ };
150
+ for (const s of deck.slides) {
151
+ if (s.error) {
152
+ visible.push({ slide: s, section });
153
+ continue;
154
+ }
155
+ let hidden;
156
+ try {
157
+ hidden = hasFlag(s, 'hide');
158
+ }
159
+ catch (e) {
160
+ failed(s, e);
161
+ continue;
162
+ }
163
+ if (s.layout === 'section') {
164
+ // A hidden section is numbered, in the editor, as it would be; the next shown one still takes that number.
165
+ hiddenSection = hidden ? { section: { number: (section?.number ?? 0) + 1, title: sectionTitle(s) }, at: where(s) } : null;
166
+ }
167
+ if (hidden || hiddenSection) {
168
+ if (keepHidden)
169
+ visible.push({ slide: s, section: hiddenSection?.section ?? section, hiddenBy: hidden ? where(s) : hiddenSection.at });
170
+ continue;
171
+ }
172
+ if (s.layout === 'section') {
173
+ section = { number: (section?.number ?? 0) + 1, title: sectionTitle(s) };
174
+ sections.push(section);
175
+ if (!deck.meta.section_slides && !hasFlag(s, 'show'))
176
+ continue;
177
+ }
178
+ visible.push({ slide: s, section });
179
+ }
180
+ const shown = visible.filter((v) => !v.hiddenBy).length;
181
+ if (shown === 0 && !keepHidden)
182
+ throw new DeckError('the deck has no visible slides (section slides are hidden unless section_slides: true; {hide} drops a slide)');
183
+ if (visible.length === 0)
184
+ throw new DeckError('the deck has no slides');
185
+ deck.slides = visible.map(({ slide }, i) => ({ ...slide, number: i + 1 }));
186
+ // Page numbers as presented: hidden slides take none.
187
+ let presented = 0;
188
+ const pages = visible.map((v) => (v.hiddenBy ? undefined : ++presented));
189
+ // Every deck carries the sidebar so `t` can toggle it; `toc: sidebar` only makes it visible from the start.
190
+ const toc = buildToc(deck.slides, visible.map((v) => v.section), sections, visible.map((v) => !!v.hiddenBy));
191
+ const errors = [];
192
+ const showError = (s, i) => {
193
+ errors.push(s.error);
194
+ const lines = sources[s.file ?? path.basename(file)].split(/\r?\n/).slice(s.line - 1, s.end);
195
+ return renderer.renderErrorSlide(s, deck.slides.length, visible[i].section, lines.join('\n'), path.basename(file));
196
+ };
197
+ const units = deck.slides.map((s, i) => {
198
+ let html;
199
+ if (s.error)
200
+ html = showError(s, i);
201
+ else {
202
+ try {
203
+ html = renderer.renderSlide(s, deck, deck.slides.length, visible[i].section, toc, { page: pages[i], pages: shown, hiddenBy: visible[i].hiddenBy });
204
+ }
205
+ catch (e) {
206
+ const located = inFile(e, s.file);
207
+ if (!forgiving || !(located instanceof DeckError))
208
+ throw located;
209
+ html = showError(errorSlide(s, located), i);
210
+ }
211
+ }
212
+ return html;
213
+ });
214
+ const mode = deck.meta.mode ?? theme.manifest.default_mode ?? 'light';
215
+ // !important: the theme sets --deck-accent with more specific selectors (per theme, again for dark slides).
216
+ // Derived tokens (diagrams, chips, highlights, series) follow it unless the theme pins them.
217
+ const accent = deck.meta.accent ? `.deck .slide{--deck-accent:${deck.meta.accent} !important}` : '';
218
+ const title = (deck.meta.title ?? deck.slides[0].columns[0].markdown.match(/^#\s+(.*)$/m)?.[1] ?? 'Deck').replace(/[*_`]/g, '');
219
+ const css = [readFileSync(path.join(RUNTIME_DIR, 'base.css'), 'utf8'), theme.css, localCss, accent].join('\n');
220
+ const runtime = readFileSync(path.join(RUNTIME_DIR, 'runtime.js'), 'utf8');
221
+ const shell = `<!doctype html>
222
+ <html lang="en">
223
+ <head>
224
+ <meta charset="utf-8">
225
+ <meta name="viewport" content="width=device-width, initial-scale=1">
226
+ <meta name="generator" content="treasure-deck">
227
+ <title>${escapeHtml(title)}</title>
228
+ ${fontLink(theme.manifest.fonts ?? [])}
229
+ <style>
230
+ ${css}
231
+ </style>
232
+ </head>
233
+ <body>
234
+ <div class="deck${deck.meta.toc === 'sidebar' ? ' show-toc' : ''}" data-theme="${escapeHtml(theme.manifest.name)}" data-mode="${mode}">
235
+ <div class="deck-stage">
236
+ ${STAGE}
237
+ </div>
238
+ </div>
239
+ <script>
240
+ ${runtime}
241
+ </script>
242
+ </body>
243
+ </html>
244
+ `;
245
+ return { html: joinStage(shell, units), shell, units, deck, title, theme: theme.manifest.name, sources, errors, videos: renderer.videos, inlined: renderer.inlined };
246
+ }
247
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAyB,MAAM,YAAY,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAkC,MAAM,aAAa,CAAC;AAEnF,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC7F,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AAC5D,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;AAClE,MAAM,CAA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